package cn.tedu.fy.pethome.controller;

import cn.tedu.fy.pethome.pojo.dto.SuppliesAddNewDTO;
import cn.tedu.fy.pethome.service.ISuppliesService;
import cn.tedu.fy.pethome.web.JsonResult;
import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author KJ2476
 * @date 2022/7/23
 **/
@Slf4j
@RestController
@RequestMapping("/supplies")
@Api("宠物用品")
public class SuppliesController {
    @Autowired
    ISuppliesService suppliesService;

    @PostMapping("/add-new")
    @ApiOperation("添加宠物用品")
    @ApiOperationSupport(order = 100)
    public JsonResult addNew(SuppliesAddNewDTO suppliesAddNewDTO) {
        log.debug("接受到添加宠物用品的请求,参数为：{}",suppliesAddNewDTO);
        suppliesService.insert(suppliesAddNewDTO);
        return JsonResult.ok();
    }

}
